package com.ChengXiZi.mapper;

import com.ChengXiZi.entity.Community;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface CommunityMapper {

    /**
     * 根据名称查询社区
     * @param name
     * @return
     */
    @Select("select * from community where name = #{name}")
    Community selectByName(String name);

    /**
     * 新增社区
     * @param community
     */
    void insert(Community community);

    /**
     * 根据id查询社区
     * @param communityId
     * @return
     */
    @Select("select * from community where id = #{communityId}")
    Community selectById(Long communityId);
}
